package com.foodcommunity.mapper;

import com.foodcommunity.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CategoryMapper {
    List<Category> selectAll();
    Category selectById(Long id);
    
    /**
     * 统计分类下的文章数量
     * @param categoryId 分类ID
     * @return 文章数量
     */
    int countPostsByCategory(@Param("categoryId") Long categoryId);
} 